program pihome;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x, y, pin: real;
  i, n0, n: integer;
  fout: TextFile;
begin
  AssignFile(fout, 'output.txt');
  Rewrite(fout);
  n:=0;
  n0:=0;
  for i:=1 to 1000000000 do
  begin
    x:=2*random;
    y:=2*random;
    if ((x-1)*(x-1)+(y-1)*(y-1)<=1) then
      n0:=n0+1;
    n:=n+1;
    pin:=n0/n ;
    pin:=pin*4;
    if (n mod 31250)=0 then
      writeln(fout,  n , ' ' , (pi- pin):0:10 );
  end;
  CloseFile(fout);
end.
